1. Field of the Invention
The present invention relates to information management in a computer system. In particular, it relates to a structure and process for maintaining client application information in a stateless web browser/web server environment. More particularly, the present invention relates to a process for storing and retrieving arbitrary state information for a client application in a web server that does not otherwise retain state information.
2. Background and Related Art
The Internet and World Wide Web enable web users to view or browse large volumes of information from their desktop computers. The client system and server system communicate using a network protocol such as the Hypertext Transfer Protocol (HTTP.) Each complete exchange between a client browser and a server is independent of all other exchanges. A complete exchange (or transaction) includes a client request for data and a server response providing the requested data. The server does not retain any information for use when the client makes additional requests of that server. The client browser/server environment is therefore a stateless environment because each transaction is independent of the previous application state.
Independent transactions are not problematic when the client is simply requesting pages of stored information. Most browsers support an ability to include limited state information in the response to the client. For example, the server response may include information about the file and page returned so that the client can make a xe2x80x9cnext pagexe2x80x9d request of the server. State information is preserved in current browsers using one of three techniques: saving data in the uniform resource locator (URL) used to locate the server; saving data in hidden fields on the page of data returned by the browser; or saving data in a xe2x80x9ccookiexe2x80x9d on the client workstation. For example, a URL for paging through a particular file can store the file and page as follows:
http://domain/appln/tnpage?name=test.fileandpage=3
Storing data in the URL is limited to approximately 2-4 k bytes of data per URL. It is also awkward to retain large amounts of data because the string containing the data becomes long and complicated. The server software must parse the string to obtain the data thereby decreasing application response time.
The second approach for storing data is also limited by the size of the page returned. The use of cookies is limited by client storage limitations and requires the user to permit local cookie storage. Users often disable cookie storage for security reasons. If cookie storage is disabled, an application relying on cookies for state information would fail. In all three cases, state information must be sent from the server to the client which then returns the information to the server in the next request so the server can establish the state before continuing. This exchange increases the load on network resources and slows transaction response time and capacity by adding e.g. 4 K to each transmission in each direction. Exchanging information between the client and server is impractical when an application requires a large amount of state information.
Application state maintenance is exacerbated in applications that create returned pages dynamically. Internet applications that perform complex logic often employ JavaScript programs to lookup and format data for return. JavaScript is an interpreted programming language designed by Netscape Communications for performing custom logic and dynamic page building in response to a client browser request. An application that returns dynamically constructed pages has no xe2x80x9cfilexe2x80x9d or xe2x80x9cpagexe2x80x9d from which to reference a xe2x80x9cnext pagexe2x80x9d or similar request. The more complex logic permitted by JavaScript encourages applications that interact with the user collecting progressively more information or progressing through a decision tree toward a final outcome. The inability to preserve state is a serious shortcoming of JavaScript applications.
Netscape has attempted to address this problem by creating a browser independent xe2x80x9cclient objectxe2x80x9d on the server. This object is created and exists once for each client session. The client object can store state information as attributes which are then accessible to subsequent client transactions. The JavaScript program implements client object storage by assigning values to the client attributes, e.g.
client.name=xe2x80x9cJohn Smithxe2x80x9d
client.jobid=3725
client.textfile=xe2x80x9cc:testdata.filexe2x80x9d
Client object state storage is an improvement over previous techniques because the data may not need to be transmitted back and forth between client and server. The client object, however, does not support complex applications. Existing client object implementations mask, but do not solve, the above problems. The client object stores data using user selected techniques. The prevalent techniques employ wrappers for URL or cookie storage and actually operate as described above. The wrappers mask the complexities of URL or cookie storage but suffer from the same storage and network transmission problems discussed above. Another selectable technique permits local server area storage, but provides no mechanism to release and reclaim that storage. This technique eventually exhausts the server storage leading to server failure. The ability to store arbitrary amounts of data is limited by the need to allocate client object storage for each server client. The limited allocation restricts the amount of data that can actually be retained for an application. The client object does not satisfy the need to retain large amounts of state information in a complex network based application. Thus, a technical problem exists of providing a method or system for storing arbitrarily complex application state information in a stateless web browser environment.
The present invention is directed to a system, method and computer program product for managing an arbitrary state of an application in an otherwise stateless browser environment.
The present invention is directed to a computer implemented method for retaining state information on a server, the method comprising the steps of: defining an object storage area in memory, if not previously defined; receiving a request to store a piece of data in the object storage area; incrementing an item count of the number of pieces of data stored in the object storage area; creating a storage reference based on the item count; and storing the piece of data in the object storage at a location referenced by the storage reference.
It is therefore an object of the invention to provide a means for storing arbitrary application state without transmitting the state back to the client browser.
It is another object of the present invention to enable storage of arbitrarily sized amounts of information without penalizing web server performance.
It is yet another object of the invention to enable programmatic access to retained state information and to enable explicit freeing and garbage collection of storage resources.
The foregoing and other objects, features and advantages of the invention will be apparent from the following more particular description of a preferred embodiment of the invention, as illustrated in the accompanying drawing wherein like reference numbers represent like parts of the invention.